<%--
  Created by IntelliJ IDEA.
  User: 13095
  Date: 2024/11/2
  Time: 15:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<html>
<head>
    <title>完成的订单</title>

    <title>可接任务</title>
    <script src="${path}/static/js/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="${path}/static/css/staffcss.css">
    <script src="${path}/static/js/script.js"></script>

</head>
<body>
<div class="container">
    <header>
        <c:if test="${requestScope.ordersPageInfo.list.size()!=0&&requestScope.ordersPageInfo!=null}">
        <h1>完成的订单</h1>
        </c:if>
        <c:if test="${requestScope.ordersPageInfo.list.size()==0}">
        <h1 style="color: red">没有数据</h1>
        </c:if>
        <jsp:include page="inc/inc.jsp"></jsp:include>
    </header>
    <main>
        <table>
            <tr>
                <th>订单编号</th>
                <th>描述</th>
                <th>评价</th>
                <th>操作</th>
            </tr>
            <c:forEach var="orders" items="${requestScope.ordersPageInfo.list}">
                <tr>
                    <td>${orders.orderNumber}</td>
                    <td>${orders.task.description}</td>
                    <td><c:if test="${orders.status==4}"><a href="/runner/review?orderID=${orders.id}" >已评价</a></c:if>
                        <c:if test="${orders.status==3}">待评价</c:if> </td>
                    <td><a href="/runner/delteComOrder?id=${orders.id}">删除</a> </td>
                </tr>
            </c:forEach>
        </table>
        <div class="pagination" >
            <c:if test="${requestScope.ordersPageInfo.hasPreviousPage}">
                <a href="${path}/runner/completedOrderList?page=${requestScope.ordersPageInfo.pageNum - 1}" title="上一页">上一页</a>
            </c:if>
            <c:forEach begin="1" end="${requestScope.ordersPageInfo.pages}" var="pageNum">
                <c:choose>
                    <c:when test="${pageNum == requestScope.ordersPageInfo.pageNum}">
                        <span class="current-page" title="当前页：${pageNum}">${pageNum}</span>
                    </c:when>
                    <c:otherwise>
                        <a href="${path}/runner/historyOrders?page=${pageNum}" title="跳转到第 ${pageNum} 页">${pageNum}</a>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
            <c:if test="${requestScope.ordersPageInfo.hasNextPage}">
                <a href="${path}/runner/completedOrderList?page=${requestScope.ordersPageInfo.pageNum + 1}" title="下一页">下一页</a>
            </c:if>
        </div>
    </main>
</div>
</body>
</html>
